<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>目录</title>
  <link href="../Styles/styles.css" rel="stylesheet" type="text/css"/>
</head>

<body>
  <h2 id="table_of_contents">目录</h2>

  <p class="h2subheading">— 你的书的地图 —</p>

  <p>EPUB supports a Table of Contents (abbreviated as TOC) to help readers navigate their way around your book. Typically EPUB ereaders provide a button or menu item to open the TOC.</p>
  <p>EPUB 支持目录（缩写为 TOC），以帮助读者浏览您的书籍。通常，EPUB 电子阅读器会提供一个按钮或菜单项来打开目录。</p>

  <p>Sigil provides several ways to work with a TOC. The Table of Contents window in Sigil gives you a dynamic view of your TOC – you can view exactly what your TOC looks like, and select entries to jump to. The Generate TOC function can create a new TOC based on the headings in your document. The Edit TOC function allows you to update an existing TOC when you can’t or don’t want to use Generate TOC. And Create HTML TOC can create a new HTML page in your document showing what is in the EPUB TOC.</p>
  <p>Sigil 提供了几种使用 TOC 的方法。Sigil 中的“目录”窗口为您提供了 TOC 的动态视图——您可以准确查看 TOC 的外观，然后选择要跳转的条目。生成目录功能可以基于文档中的标题创建新的目录。使用“编辑目录”功能，您可以在不需要或不希望使用“生成目录”时更新现有目录。创建 HTML TOC 可以在文档中创建一个新的 HTML 页面，显示 EPUB TOC 中的内容。</p>

  <h3 class="sigil_not_in_toc">查看目录</h3>

  <p>To open the TOC window if it isn’t already open select the menu item <span class="menuitem">View→Table of Contents</span>:</p>
  <p>要打开目录窗口（如果尚未打开），请选择菜单项 <span class="menuitem">视图→目录</span>：</p>

  <div class="image">
    <img alt="toc-main" src="../Images/toc-main.png"/>
  </div>

  <p>You can single-click on an entry to jump to its location in the book, and expand or collapse entries by clicking on the icons to the left of the chapter names if there are sub-chapters.</p>
  <p>您可以单击一个条目以跳到书中的位置，如果有子章节，则可以通过单击章节名称左侧的图标来展开或折叠条目。</p>

  <div class="tip">
    <p class="tiptext">Use the right-click context menu to select <span class="menuitem">Collapse All</span> or <span class="menuitem">Expand All</span> to quickly show or hide sub-chapters.</p>
    <p class="tiptext">使用右键单击上下文菜单选择 <span class="menuitem">全部折叠</span> 或 <span class="menuitem">全部展开</span> 以快速显示或隐藏子章。</p>
  </div>

  <p>An EPUB Table of Contents is stored in the <span class="example">toc.ncx</span> file listed in the Book Browser.</p>
  <p>EPUB目录存储在“书本浏览器”中列出的 <span class="example">toc.ncx</span> 文件中。</p>

  <h3 class="sigil_not_in_toc">生成目录</h3>

  <p>In order to create a Table of Contents automatically you first need to define the headings or chapters in your book.</p>
  <p>为了自动创建目录，您首先需要在书中定义标题或章节。</p>

  <p>In Code View you can create the your headings by selecting the text you want to make into a heading, and then selecting the level of the heading you want from the <span class="menuitem">Format→Heading</span> menu. Or more easily by using the formatting buttons on the toolbar.</p>
  <p>在“代码视图”中，可以通过选择要添加为标题的文本，然后从<span class="menuitem">格式→标题</span> 菜单中选择所需的标题级别来创建标题。或者使用工具栏上的格式按钮更轻松。</p>

  <div class="image">
    <img alt="heading toolbar icons" src="../Images/headings.png" width="40%"/>
  </div>

  <div class="tip">
    <p class="tiptext">If your chapter names do not use heading tags (<span class="example">h1</span>, <span class="example">h2</span>, etc.) as described above, then you will not be able to generate a TOC automatically.</p>
    <p class="tiptext">如果您的章节名称不使用如上所述的标题标签（<span class="example">h1</span>，<span class="example">h2</span> 等），则您将不能自动生成目录。</p>
  </div>

  <p>Start your TOC generation by clicking the Generate Table of Contents button <img alt="generate-toc_22px" src="../Images/generate-toc_22px.png"/>, or selecting the menu item <span class="menuitem">Tools→Table Of Contents→Generate Table Of Contents</span> then select the headings you want included in the book’s Table of Contents:</p>
  <p>通过单击“生成目录”按钮 <img alt="generate-toc_22px" src="../Images/generate-toc_22px.png"/> 或选择菜单项 <span class="menuitem">工具→目录→生成目录</span> 开始生成 TOC，然后选择要包含在本书目录中的标题：</p>

  <div class="image">
    <img alt="toc-generate-toc" src="../Images/toc-generate-toc.png"/>
  </div>

  <p>Check any name that you want to be included in the Table of Contents, and uncheck any entry that you don’t want included.</p>
  <p>选中您要包含在目录中的任何名称，然后取消选中您不希望包含的任何条目。</p>

  <div class="tip">
    <p class="tiptext">When you use Generate Table Of Contents Sigil will update not only your TOC, but also your HTML documents – to make sure that the information you enter can be used again when you next generate the TOC.</p>
    <p class="tiptext">使用“生成目录”时，Sigil 不仅会更新您的目录，还会更新 HTML 文档，以确保您输入的信息可以在下次生成目录时再次使用。</p>
  </div>

  <p>You can use the <span class="buttonbox">Show TOC Items Only</span> checkbox to show or hide entries that will not be included in the TOC. This does not affect your TOC, only what you see in the dialog. You can also use the <span class="buttonbox">Select headings to include in TOC</span> drop-down menu to quickly select or unselect headings of a certain type, and then fine tune the selections manually.</p>
  <p>您可以使用 <span class="buttonbox">仅显示 TOC 项目</span> 复选框来显示或隐藏将不包含在 TOC 中的条目。这不会影响您的目录，只会影响您在对话框中看到的内容。您还可以使用 <span class="buttonbox">选择要包含在目录中的标题</span> 下拉菜单来快速选择或取消选择某种类型的标题，然后手动进行微调。</p>

  <p>You can rename the TOC entry by clicking <span class="buttonbox">Rename</span>. This will also change your HTML code to set the "title" attribute of your heading.</p>
  <p>您可以通过单击 <span class="buttonbox">重命名</span> 重命名目录。这还将更改您的 HTML 代码，以设置标题的“标题”属性。</p>

  <p>You can change the level of your Headings using the left and right arrow keys. This will also change the level of the headings in your HTML code.</p>
  <p>您可以使用左右箭头键更改标题的级别。这还将更改 HTML 代码中标题的级别。</p>

  <div class="tip">
    <p class="tiptext">The tooltip for each title (just move your mouse over the title and leave it for a few seconds) will show you which file the heading is in and its HTML code.</p>
    <p class="tiptext">每个标题的工具提示（只需将鼠标移到标题上并停留几秒钟），即可显示标题所在的文件及其 HTML 代码。</p>
  </div>

  <p>The tooltip for the headings of table will show you the number of headings of each type:</p>

  <div class="image">
    <img alt="toc-tooltip" src="../Images/toc-tooltip.png"/>
  </div>

  <p>When you select <span class="buttonbox">OK</span>, Sigil will add or update automatically generated IDs to any headings you have selected if they don’t have regular IDs already. It will then create a new <span class="example">toc.ncx</span> file containing links to your chapters. If your heading is "near" the beginning of your HTML file, Sigil will link directly to the file and not to the heading ID. This is because on some ereaders linking directly to an element slows down the display of the TOC.</p>
  <p>当您选择 <span class="buttonbox">确定</span>时，Sigil 会将自动生成的 ID 添加或更新到您选择的任何标题（如果它们还没有常规 ID）。然后，它将创建一个新的 <span class="example">toc.ncx</span>文件，其中包含指向您的章节的链接。如果标题位于 HTML 文件开头附近，则 Sigil 将直接链接到文件而不是标题 ID。这是因为在某些电子阅读器上，直接链接到元素会降低 TOC 的显示速度。</p>

  <div class="tip">
    <p class="tiptext">Generating the TOC automatically will overwrite any existing TOC in the <span class="example">toc.ncx</span> file.</p>
    <p class="tiptext">自动生成 TOC 将覆盖 <span class="example">toc.ncx</span> 文件中的所有现有 TOC。</p>
  </div>

  <h3 class="sigil_not_in_toc" id="edit_toc">编辑目录</h3>

  <p>If you can’t or don’t want to generate the TOC from the headings in the document, you can use Edit Table Of Contents to make changes to the existing TOC. Any changes made to the TOC will not affect your HTML files, and all changes would be lost if you use Generate TOC.</p>
  <p>如果您不能或不想根据文档的标题生成目录，可以使用“编辑目录”对现有目录进行更改。对 TOC 所做的任何更改都不会影响您的 HTML 文件，如果您使用 Generate TOC，所有更改都将丢失。</p>

  <div class="image">
    <img alt="edit-toc" src="../Images/edit-toc.png"/>
  </div>

  <p>You can edit an entry by double-clicking on it. You can add new entries or delete existing ones. Use the arrows to increase or decrease the heading level of an entry.</p>
  <p>您可以通过双击来编辑条目。您可以添加新条目或删除现有条目。使用箭头增加或减少条目的标题级别。</p>

  <p>To change what a TOC entry points to you can type in the target destination directly, or use the <span class="buttonbox">Insert Link</span> button. This will open the Select Target dialog where you can choose which location to point the TOC entry to:</p>
  <p>要更改 TOC 条目指向的内容，可以直接输入目标位置，或使用 <span class="buttonbox">插入链接</span>按钮。这将打开“选择目标”对话框，您可以在其中选择将 TOC 条目指向的位置：</p>

  <div class="image">
    <img alt="select-target" src="../Images/select-target.png"/>
  </div>

  <p>The right-click context menu allows you to delete or rename entries, or expand or collapse the list.</p>
  <p>右键单击上下文菜单允许您删除或重命名条目，或展开或折叠列表。</p>

  <div class="tip">
    <p class="tiptext">TOC entries must point to a valid target. If you just want a heading in the TOC, point it to the next valid entry.</p>
    <p class="tiptext">TOC 条目必须指向有效的目标。如果只想在目录中输入标题，请将其指向下一个有效条目。</p>
  </div>

  <h3 class="sigil_not_in_toc" id="generate_html_toc">生成 HTML 目录</h3>

  <p>You can use the menu <span class="menuitem">Tools→Table Of Contents→Generate HTML Table of Contents</span> to create an Inline HTML TOC for your EPUB.</p>
  <p>您可以使用菜单 <span class="menuitem">工具→目录→生成 HTML 目录</span> 为您的 EPUB 创建内联 HTML TOC。</p>

  <div class="image">
    <img alt="toc-html" src="../Images/toc-html.png"/>
  </div>

  <p>An inline TOC is just another HTML page in the EPUB that contains the Table of Contents in text format with links that can be used to jump to specific chapters.</p>
  <p>内联目录仅是 EPUB 中的另一个 HTML 页面，其中包含文本格式的目录和可用于跳至特定章节的链接。</p>

  <p>For most EPUB ereaders, the TOC that is automatically generated from Generate Table Of Contents or stored in <span class="example">toc.ncx</span> is used to display the TOC. However, there are times when an inline TOC is desired in an EPUB or when it is temporarily needed because the EPUB will be converted to another ebook format that does not use the EPUB TOC file.</p>
  <p>对于大多数 EPUB 电子阅读器，从“生成目录”自动生成或存储在 <span class="example">toc.ncx</span>中的 TOC 用于显示 TOC。但是，有时在 EPUB 中需要内嵌目录或临时需要内嵌目录，因为 EPUB 将被转换为不使用 EPUB TOC 文件的另一种电子书格式。</p>

  <p>The Generate HTML Table of Contents menu item will overwrite any existing HTML TOC file (if it has a semantic type of TOC). If no such file exists it will create an HTML file called <span class="example">TOC.xhtml</span> and mark its semantic type as TOC. If <span class="example">TOC.xhtml</span> already exists it will be replaced.</p>
  <p>“生成 HTML 目录”菜单项将覆盖任何现有的 HTML TOC 文件（如果它的语义类型为 TOC）。如果不存在这样的文件，它将创建一个名为 <span class="example">TOC.xhtml</span> 的 HTML 文件，并将其语义类型标记为 TOC。如果<span class="example">TOC.xhtml</span> 已经存在，它将被替换。</p>

  <div class="tip">
    <p class="tiptext">You can change the contents of the inline TOC once you’ve created it – but remember to do this each time you create the TOC.</p>
    <p class="tiptext">创建内联目录时，您可以更改其内容；但是请记住，每次创建目录时都必须进行此操作。</p>
  </div>

  <h4 class="sigil_not_in_toc">自定义 HTML TOC 样式表</h4>

  <p>The generated HTML TOC page uses a separate CSS file (<span class="example">sgc-toc.css</span>) to format the TOC. If the file already exists in your book it will not be overwritten (so you can customise it without losing your changes). But if it does not exist, it will look for <span class="example">sgc-toc.css</span> in your preferences directory and use that as the default file. If there is no file in your preferences directory, then Sigil will create a default stylesheet for the TOC.</p>
  <p>生成的 HTML TOC 页面使用单独的 CSS 文件（<span class="example">sgc-toc.css</span>）来格式化 TOC。 如果文件已经存在于您的书中，则不会被覆盖（因此您可以自定义它而不会丢失所做的更改）。但是，如果它不存在，它将在您的首选项目录中查找 <span class="example">sgc-toc.css</span> 并将其用作默认文件。如果您的首选项目录中没有文件，则 Sigil 将为目录创建默认样式表。</p>

  <p>If you’re generating an EPUB3 TOC, Sigil will look for <span class="example">sgc-nav.css</span> in your preferences directory and use that as the default file.</p>
  <p>如果您要生成 EPUB3 目录，Sigil 将在您的首选项目录中查找 <span class="example">sgc-nav.css</span> 并将其用作默认文件。</p>

  <h4 class="sigil_not_in_toc">更新 Epub3 书籍中的 NCX TOC</h4>

  <p>If you create an EPUB3 book with Sigil or open an EPUB3 book without an NCX file, Sigil will generate an empty NCX TOC for backwards compatibility. However, like the HTML TOC in EPUB2 books, Sigil won’t automatically update the NCX TOC in EPUB3 books when you regenerate the TOC.</p>
  <p>如果使用 Sigil 创建 EPUB3 书籍或打开没有 NCX 文件的 EPUB3 书籍，Sigil 将生成一个空的 NCX TOC 以实现向后兼容。但是，就像 EPUB2 图书中的 HTML TOC 一样，Sigil 不会在您重新生成 TOC 时自动更新 EPUB3 图书中的 NCX TOC。</p>

  <p>Make sure to select Tools &gt; Epub3 Tools &gt; Generate NCX from Nav once you’ve finalized the TOC.</p>
  <p>完成 TOC 后，请确保选择 工具 &gt; Epub3工具 &gt; 从 Nav 生成 NCX。</p>
</body>
</html>